home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Extensions / Imaging / README < prev   
Encoding:
Text File  |  2000-06-23  |  8.9 KB  |  262 lines

  1.  
  2. The Python Imaging Library
  3. $Id: README,v 1.1.1.2 1999/01/13 09:39:32 sjoerd Exp $
  4.  
  5. Release 1.0 beta 1 (January 1, 1999)
  6.  
  7. ====================================================================
  8. The Python Imaging Library 1.0 beta 1
  9. ====================================================================
  10.  
  11. Contents
  12. --------
  13.  
  14. + Introduction
  15. + Software License
  16. + Build instructions for UNIX
  17. + Build instructions for Windows
  18.  
  19. --------------------------------------------------------------------
  20. Introduction
  21. --------------------------------------------------------------------
  22.  
  23. The Python Imaging Library adds image processing capabilities to your
  24. Python interpreter.  This library provides extensive file format
  25. support, an efficient internal representation, and fairly powerful
  26. image processing capabilities.
  27.  
  28. This is hopefully the only beta release of 1.0 (formerly known as
  29. 0.3).  If no serious problems are found with this release, it will
  30. be rereleased as 1.0 final before then end of January 1999.
  31.  
  32. This source kit has been built on Windows 95, 98 and NT, as well as
  33. on Linux (Redhat 4.2) and Digital Unix.  It should build out of the
  34. box on most mainstream Unix versions.
  35.  
  36. The main distribution site for this software is:
  37.  
  38.     http://www.pythonware.com
  39.  
  40. The PIL handbook is not included in this distribution; to get the
  41. latest version (which may not be entirely up to date at the time of
  42. this release), check:
  43.  
  44.     http://www.pythonware.com/library.htm
  45.  
  46. --------------------------------------------------------------------
  47. News highlights in 1.0b1 (as compared to 0.2):
  48.  
  49. + Improved font support.  The pilfont package is now included
  50.   in the core distribution.
  51.  
  52. + Improved graphics support, including arc, chord, and pieslice
  53.   primitives.
  54.  
  55. + Conversion to "P" and "1" uses Floyd-Steinberg dithering.
  56.   Conversion to "P" can use "web" colours or adaptive palette.
  57.  
  58. + Added support for "YCbCr" image memories.
  59.  
  60. + Added support for 32-bit integer and floating point images,
  61.   including new decoders to deal with many kinds of input data.
  62.  
  63. + The Tk interface now supports transparent images.
  64.   *** NOTE: the Tk interface has been changed; you need to update
  65.   *** your Tkinter build to properly handle the new interface.
  66.  
  67. + Added read support for IPTC/NAA Newsphoto, McIdas, PIXAR raster,
  68.   FlashPix, Microsoft Image Composer, and XV thumbnails.
  69.  
  70. + Lots and lots of bug fixes.
  71.  
  72. For more information on these and other changes, see the CHANGES
  73. document.
  74.  
  75. For installation and licensing details, see below.
  76.  
  77. For questions, comments and bug reports, send mail to
  78. 'image-sig@python.org'.
  79.  
  80. --------------------------------------------------------------------
  81. Software License
  82. --------------------------------------------------------------------
  83.  
  84. The Python Imaging Library is
  85.  
  86. Copyright (c) 1997-1999 by Secret Labs AB
  87. Copyright (c) 1995-1999 by Fredrik Lundh
  88.  
  89. By obtaining, using, and/or copying this software and/or its
  90. associated documentation, you agree that you have read, understood,
  91. and will comply with the following terms and conditions:
  92.  
  93. Permission to use, copy, modify, and distribute this software and its
  94. associated documentation for any purpose and without fee is hereby
  95. granted, provided that the above copyright notice appears in all
  96. copies, and that both that copyright notice and this permission notice
  97. appear in supporting documentation, and that the name of Secret Labs
  98. AB or the author not be used in advertising or publicity pertaining to
  99. distribution of the software without specific, written prior
  100. permission.
  101.  
  102. SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
  103. THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  104. FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR
  105. ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  106. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  107. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  108. OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  109.  
  110.  
  111. --------------------------------------------------------------------
  112. Build instructions for UNIX
  113. --------------------------------------------------------------------
  114.  
  115. NOTE: To build the Python Imaging Library, you need an ANSI C com-
  116. piler.  The "cc" compiler on SunOS 4 is *not* ANSI compliant.  On that
  117. platform, use "acc" or "gcc" instead.  On some platforms, you may have
  118. to use compiler options like "-ansi" or "-std" to get full ANSI C
  119. support.
  120.  
  121. 1. If you need JPEG and/or PNG support, make sure to get and build
  122.    the necessary external libraries:
  123.  
  124.    - for JPEG support, get the IJG JPEG library, version 6a or 6b.
  125.  
  126.    - for PNG and ZIP support, get the ZLIB library (by Gailly/Adler).
  127.      PIL was tested with version 1.0.4, but is likely to work with
  128.      versions from 0.95 and onwards.
  129.  
  130.      If you have RedHat 4.2 or newer, the libraries provided with
  131.      the operating system should work just fine.
  132.  
  133.  
  134. 2. Unpack the PIL distribution (the file Imaging-1.0b1.tar.gz) in your
  135.    Python/Extensions directory.
  136.  
  137.     $ cd Python-1.5/Extensions # example
  138.     $ gunzip Imaging-1.0b1.tar.gz
  139.     $ tar xvf Imaging-1.0b1.tar
  140.  
  141.  
  142. 3. Now build the Imaging core library (libImaging.a):
  143.  
  144.     $ cd Imaging-1.0b1/libImaging
  145.     $ ./configure
  146.     $ make
  147.  
  148.    If you need to specify additional compiler options, the
  149.    second line should look something like:
  150.  
  151.     $ CC="cc -ansi" ./configure
  152.  
  153.  
  154. 4. To check that this library works as it should, type:
  155.  
  156.     $ make check
  157.  
  158.    (It isn't much of a test, but at least it shouldn't crash :-)
  159.  
  160.  
  161. 5. Go back to the Imaging directory.
  162.  
  163.    If you don't have the IJG JPEG or ZLIB libraries (or you have them,
  164.    but not in a standard place), copy the "Setup.in" file to "Setup"
  165.    and edit it according to the instructions in the file.
  166.  
  167.  
  168. 6. Edit Makefile.pre.in and build a Makefile following the instructions
  169.    there.  In most cases, you can simply give the following command:
  170.  
  171.     $ make -f Makefile.pre.in boot
  172.  
  173.  
  174. 7. To build a dynamically loaded module, just type "make":
  175.  
  176.     $ make
  177.  
  178.    This will create a file called "_imaging.so".
  179.  
  180.    Then type (assuming a standard shell):
  181.  
  182.     $ PYTHONPATH=.:./PIL ; export PYTHONPATH
  183.     $ python
  184.  
  185.     >>> import _imaging
  186.     >>> import Image
  187.  
  188.    If both imports works, you've successfully added PIL to your Python
  189.    environment.  There are a few demo scripts in the Imaging/Scripts
  190.    directory that you can use to further test the library.
  191.  
  192.  
  193. 8. Copy the "_imaging.so" module and the contents of the "Imaging/PIL"
  194.    directory to a suitable place along the Python path.
  195.  
  196.    If you're using Python 1.5 or later, the preferred way is to create
  197.    a "PIL" subdirectory under "site-packages", copy the "PIL.pth" file
  198.    to "site-packages", and the rest of the files to the new subdirectory.
  199.  
  200.    Example:
  201.  
  202.     $ cp PIL.pth /usr/local/lib/Python1.5/site-packages
  203.     $ mkdir /usr/local/lib/Python1.5/site-packages/PIL
  204.     $ cp _imaging.so PIL/* /usr/local/lib/Python1.5/site-packages/PIL
  205.  
  206.  
  207. * Adding Tkinter support
  208.  
  209. 1. Compile Python's _tkinter.c with the WITH_APPINIT and WITH_PIL
  210.    flags set, and link it with tkImaging.c and tkappinit.c.  To
  211.    do this, copy the former to the Modules directory, and edit
  212.    the _tkinter line in Setup (or Setup.in) according to the
  213.    instructions in that file.
  214.  
  215.    NOTE: if you have an old Python version, the tkappinit.c
  216.    file is not included by default.  If this is the case, you
  217.    will have to add the following lines to tkappinit.c, after
  218.    the MOREBUTTONS stuff:
  219.  
  220.     {
  221.         extern void TkImaging_Init(Tcl_Interp* interp);
  222.         TkImaging_Init(interp);
  223.     }
  224.  
  225.    This registers a Tcl command called "PyImagingPhoto", which is
  226.    use to communicate between PIL and Tk's PhotoImage handler.
  227.  
  228.    You must also change the _tkinter line in Setup (or Setup.in)
  229.    to something like:
  230.  
  231.    _tkinter _tkinter.c tkImaging.c tkappinit.c -DWITH_APPINIT
  232.     -I/usr/local/include -L/usr/local/lib -ltk4.2 -ltcl7.6 -lX11
  233.  
  234.  
  235. --------------------------------------------------------------------
  236. Build instructions for Windows
  237. --------------------------------------------------------------------
  238.  
  239. The current release does not include Windows makefiles.  You can get
  240. a prebuilt version from:
  241.  
  242.     http://www.pythonware.com/downloads.htm
  243.  
  244. That version is compatible with Python interpreters build using
  245. Microsoft Visual C++ 5.0.
  246.  
  247. Building your own copy under Visual Studio should be straightforward;
  248. create a new project based on the sample extensions provided with
  249. Python (the target should be "_imaging.dll"), add all C files except
  250. "Except.c" and "coretest.c" to that project, check the contents of the
  251. "ImConfig.h" file (modify it if necessary), and build the DLL.
  252.  
  253. (If I'd used Visual Studio myself, I would have provided a project
  254. file.  But I don't.  Contributions are welcome, though...)
  255.  
  256. --------------------------------------------------------------------
  257. NOTE: If you use Tk on Windows, you may wish to install the booster
  258. patches which provides dramatic performance improvements for 16- and
  259. 24-bit displays.  See the description in the Tk subdirectory for
  260. details.
  261. --------------------------------------------------------------------
  262.